//
//  ViewController.m
//  16-HomeWork-CycleImage
//
//  Created by dllo on 16/8/4.
//  Copyright © 2016年 DM.C. All rights reserved.
//

#import "ViewController.h"
#import "DMCCycleImages.h"
@interface ViewController ()<SelectItemDelegate, CDMCycleImagesDataSource>
@property (weak, nonatomic) IBOutlet DMCCycleImages *cycleImages;


@end

@implementation ViewController
- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    NSMutableArray *array = [NSMutableArray array];
    for (int i = 0; i < 5; i++) {
        [array addObject:[NSString stringWithFormat:@"%d", i]];
    }
    NSString *firstImage = [array firstObject];
    NSString *lastImage = [array lastObject];
    [array insertObject:lastImage atIndex:0];
    [array addObject:firstImage];
    _cycleImages.array = array;
    _cycleImages.label.text = @"这是一个标题";
    _cycleImages.delegate = self;
    _cycleImages.dataSource = self;
}
- (void)collectionView:(UICollectionView *)collectionView cell:(DMCCycleImages *)cell indexPath:(NSIndexPath *)indexPath {
    NSLog(@"点击了%ld", indexPath.row);
}
- (void)handleDataWithObject:(id)objc cell:(CDMCycleImageCell *)cell {
    [NSString stringWithString:objc];
    cell.cycleImage.image = [UIImage imageNamed:objc];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
